﻿namespace jQube.Web.UI.Controls
{
    public sealed class PostBackTrigger: Trigger
    {
        internal override bool CheckValidTrigger(ScriptManager scriptManager)
        {
            foreach (UpdatePanel updatePanel in scriptManager.UpdatePanels)
            {
                foreach (Trigger trigger in updatePanel.Triggers)
                {
                    if (trigger is AsyncPostBackTrigger && trigger.TriggerControlID == this.TriggerControlID)
                    {
                        return false;
                    }
                }
            }

            return true;
        }
    }
}
